exports.MMGameState = Core.Class.singleton(
{
	classname: 'MMGameState',
	
	initialize: function()
	{
		this._currentUser = null;
		this._useLocalTime = null;
//		this._musicOn = null;
		this._allStolenCoins = 0;								
		this._levelsInfo = {};
		this._serverTimeDiff = 0;
		this._isFirstRun = false;
		
		//@zeeshan temporary initialiation
		this._useLocalTime = true;
		
	},

	getLevelInfo:function(){
		return this._levelsInfo;
	},
	
	initiateUser: function()
	{
		this._currentUser = this.createUser();
		if(this._currentUser)
		{
			this._isFirstRun = this._currentUser.checkForFirstLaunch();
			this._currentUser.loadUser();
			this.incrementXp();
		}
		
		//this.updateOffersData();
	},
	
	createUser : function() {
		var userObj = DatabaseInterface.getUserObj();
		if(userObj) {
			var userModel = new MMUser(userObj);
			return userModel;
		}
		return null;
	},
	
	incrementXp: function()
	{
		this._currentUser.incrementXp();
	},
	
	getServerTime: function()
	{		
		var today = new Date();
		var currentDateInSec = today.getTime()/1000;
		return currentDateInSec; //Uncomment this line to enable Local Time
		
		var realTime = currentDateInSec + this._serverTimeDiff;
		return realTime;
	},
	
	getCurrentUser:function ()
	{
		return this._currentUser; 
	},
	
	getIsFirstRun: function()
	{
		return this._isFirstRun;
	},
});
	